    var clock = '';
	 var nums = 60;
	 var btn;
	function get_mobile_code(thisBtn)
	{	
	    var mobile = $("#mobile").val();
	    console.log(mobile);
        if (!isMobile(mobile)) 
        {
             alert("手机号码空或格式错误，请重新输入");
        }		 
        else
        {
        	
	      $.post('/OrderSystem/Moblie_VerityCode', 
	        		{mobile:mobile}, 
	        		function(msg) 
	        		{
	        				alert("手机验证码发送成功");
	                       // sendCode(thisBtn);
	    
	        		}
	        	  );
          
        }
	}
	
	
	
	 var clock = '';
	 var nums = 60;
	 var btn;
	 function sendCode(thisBtn)
	 { 
		 btn = thisBtn;
		 btn.disabled = true; //将按钮置为不可点击
		 btn.value = nums+'秒后可重新获取';
		 clock = setInterval(doLoop, 1000); //一秒执行一次
	 }
	 function doLoop()
	 {
		 nums--;
		 if(nums > 0)
		 {
		  btn.value = nums+'秒后可重新获取';
	 }else{
		  clearInterval(clock); //清除js定时器
		  btn.disabled = false;
		  btn.value = '点击发送验证码';
		  nums = 60; //重置时间
		 }
	 } 
	
	
	 //手机号码验证
        function isMobile(s) {
              var reg=/^((1[0-9][0-9])|(15[^4,\D])|(18[0-9]))\d{8}$/; 
             if (!reg.exec(s)) {
                return false;
             }
            return true;
            
        }      